import {req_get_auth, req_post_auth} from './axiosFun.js';
import {HOST} from '@/api/hosts';

export const getSCarRequests = (params) => {
    if (params===undefined)
        params = {}
    params.status = "S";
    const url = `${HOST}/carRequest/page`;
    return req_get_auth('get', url, params);
};
export const getAllCarRequests = (params) => {
    const url = `${HOST}/carRequest/page`;
    return req_get_auth('get', url, params);
};
export const listFreeCars = (data) => {
    const url = `${HOST}/cars/free-cars`
    return req_get_auth("get", url, data)
}
export const agreeCarRequest = (data) => {
    const url = `${HOST}/carRequest/agree`
    return req_post_auth("put", url, data);
};

export const rejectCarRequest = (data) => {
    const url = `${HOST}/carRequest/reject`
    return req_post_auth("put", url, data);
};
export const getFullCarRequest = (params) => {
    const url = `${HOST}/carRequest/report-detail`
    return req_get_auth("get", url, params);
};
// 添加报表
export const addStatement = (data) => {
    const url = `${HOST}/carRequest/addStatement`
    return req_post_auth("put", url, data);
};